<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../common.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="${staticPath}/js/app/address/address.js"></script>
<title>我的地址</title>
</head>
<body ontouchstart>
	<header class="contHeader">
		<div class="contOHeader" style="z-index:1000;">
			<h1>我的地址</h1>
			<div class="contOHeadBack">
				<a href="javascript:;" onclick="history.go(-1)">
					<img src="${staticPath}/images/back2.png">
				</a>
			</div>
		</div>
	</header>
	<c:if test="${addressList.size() == 0 }">
		<div class="bd">
			<div class="index-pic" style="padding-top: 120px; text-align: center;">
				<img src="${staticPath}/images/dznull.png" style="width: 80px; height: 100px;">
			</div>
			<div style="text-align: center; width: 100%; color: #999;">
				<p>暂无地址</p>
				<p>心仪的宝贝将要去何方？</p>
			</div>
		</div>
	</c:if>
	<input type="hidden" name="singleBuyFlag" id="singleBuyFlag" value="${singleBuyFlag }">
	<c:if test="${addressList.size() > 0 }">
		<div class="tjdd"></div>
		<c:forEach items="${addressList}" var="address">
			<div id="${address.id }" class="weui_cells weui_cells_access" style="padding-left: 15px;" onclick="${chooseFlag=='1'?'chooseOver(this)':''}">
				<a class="weui_cell" href="javascript:;">
					<div class="weui_cell_bd weui_cell_primary">
						<h5>收件人：${address.name }</h5>
						<p class="font12">
							送货地址：${address.province.name }
							<c:if test="${address.city != null }">
								<c:if test="${address.city.name != '其他' }">${address.city.name }</c:if>
							</c:if>
							<c:if test="${address.county != null }">
								<c:if test="${address.county.name != '其他' }">${address.county.name }</c:if>
							</c:if>
							${address.address }
						</p>
						<p class="font12">电话：${address.mobPhone }</p>
					</div>
				</a>
				<div class="button_sp_area">
					<c:if test="${address.isDefault == '0' }">
						<a href="javascript:del('${address.id }');" class="weui_btn weui_btn_mini weui_btn_primary">删除</a>
					</c:if>
					<a href="javascript:edit('${address.id }')" class="weui_btn weui_btn_mini weui_btn_primary">编辑</a>
					<c:if test="${address.isDefault == '1' }">
						<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">当前默认</a>
					</c:if>
					<c:if test="${address.isDefault == '0' }">
						<a href="javascript:setDefault('${address.id }');" class="weui_btn weui_btn_mini weui_btn_primary">设为默认</a>
					</c:if>
				</div>
			</div>
		</c:forEach>
	</c:if>
	<div style="height:40px;"></div>
	<div class="tabm">
		<a class="tabright" href="javascript:add();" style="width: 100%;">添加新地址</a>
	</div>
</body>
<script type="text/javascript" src="${staticPath}/weui/js/city-picker.js"></script>
<script type="text/javascript" src="${staticPath}/js/app/address/add.js"></script>
<script type="text/javascript" src="${staticPath}/js/app/address/edit.js"></script>
</html>